import os.path

import yaml


def load_test_data(file_path="../data/test_data.yaml"):
    with open(file_path, 'r', encoding="utf-8") as file:
        data = yaml.safe_load(file)
        print(data)

    # 列表推导式
    return [(case['book'],) for case in data['test_cases']]

#获取#绝度路径
def get_project_path():
    return os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))

def build_path(*path,add_sep_before):
    all_path=os.sep.join(path)
    if add_sep_before:
        all_path=os.sep+all_path
    return all_path
    # # 获取当前的绝对路径

# if __name__ == '__main__':
#     # load_test_data()
#     # print(load_test_data())
#     print(get_project_path())
#     print(get_project_path() + build_path("common", "tools.py", add_sep_before=True))
